from sqlalchemy import ForeignKey, String
from sqlalchemy.dialects.postgresql import TIMESTAMP, UUID
from sqlalchemy.orm import Mapped, mapped_column

from .base_model import OrmBase


class Package(OrmBase):
    __tablename__ = 'package'

    uuid: Mapped[str] = mapped_column(String(70), primary_key=True)
    created_at: Mapped[str] = mapped_column(TIMESTAMP)
    closed_at: Mapped[str] = mapped_column(TIMESTAMP, nullable=True)

    def __repr__(self) -> str:
        return (
            f'Package(uuid={self.uuid!r}, created_at={self.created_at!r},'
            f'closed_at={self.closed_at!r})'
        )
